package protoClass;

public class TcpDataSplit {

	public static int judgeDataLen(byte[] data,int len){
		int effectivelen,judgeResult;
		byte[] header = new byte[2];
		header[0] = data[0];
		header[1] = data[1];
		String str_header = ByteHandler.HexString(header);
		if ("c4d7".equalsIgnoreCase(str_header)) {
			effectivelen=(data[4]&0xFF)*256+(data[5]&0xFF)+6;
			if(effectivelen>len){
				judgeResult =0;
			}else{
				judgeResult =effectivelen;
			}
		}else{
				judgeResult =0;
		}
		return judgeResult;
	}

}
